// main.ts
import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import './style.css'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/display.css'
import { createWebHistory, createRouter } from 'vue-router'
import App from './App.vue'
// 通用页面
import home from './pages/home.vue'
import kdbList from './pages/knowledgeDB/kdbList.vue'
import kdbInfo from './pages/knowledgeDB/kdbInfo.vue'
import roleAgentList from './pages/roleAgent/roleAgentList.vue'
import roleAgentInfo from './pages/roleAgent/roleAgentInfo.vue'

import soundList from './pages/soundBank/soundList.vue'
import soundInfo from './pages/soundBank/soundInfo.vue'

import deviceList from './pages/deviceBank/deviceList.vue'
import deviceInfo from './pages/deviceBank/deviceInfo.vue'

import aisearchIndex from './pages/aisearch/aisearchIndex.vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import { createPinia } from 'pinia'
import piniaPersist from 'pinia-plugin-persist'
const pinia = createPinia()
pinia.use(piniaPersist)

const routes = [
    { path: '/', name: 'home', component: home },

    { path: '/kdbList', name: 'kdbList', component: kdbList },
    { path: '/kdbInfo/:id', name: 'kdbInfo', component: kdbInfo },
    
    { path: '/roleAgentList', name: 'roleAgentList', component: roleAgentList },
    { path: '/roleAgentInfo/:id', name: 'roleAgentInfo', component: roleAgentInfo },

    
    { path: '/deviceList', name: 'deviceList', component: deviceList },
    { path: '/deviceInfo/:id', name: 'deviceInfo', component: deviceInfo },

    
    { path: '/soundList', name: 'soundList', component: soundList },
    { path: '/soundInfo/:id', name: 'soundInfo', component: soundInfo },

    { path: '/aisearchIndex', name: 'aisearchIndex', component: aisearchIndex },

    
    
]

const router = createRouter({
    history: createWebHistory(),
    routes,
})

const app = createApp(App)
app.use(pinia)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
app.use(ElementPlus)
app.use(router)
app.mount('#app')